﻿#region

using System.Configuration;
using Lab.DataContext.DataContext;
using Lab.Server.Infrastructure;
using Ninject;

#endregion

namespace Lab.Server.Application {
    public class Context {
        private readonly StandardKernel kernel;

        public Context(IDataContext dataContext) {
            kernel = new StandardKernel();
            kernel.Bind<VacancyRepository>().ToConstructor(_ => new VacancyRepository(dataContext));
            kernel.Bind<EmployerRepository>().ToConstructor(_ => new EmployerRepository(dataContext));
            kernel.Bind<ApplicantRepository>().ToConstructor(_ => new ApplicantRepository(dataContext));
            kernel.Bind<DealRepository>().ToConstructor(_ => new DealRepository(dataContext));
            kernel.Bind<KindOfActivityRepository>().ToConstructor(_ => new KindOfActivityRepository(dataContext));
            kernel.Bind<SkillRepository>().ToConstructor(_ => new SkillRepository(dataContext));
        }

        public T Get<T>() {
            return kernel.Get<T>();
        }
    }
}